<?php
/**
* SocialEngine
*
* @category   Application_Extensions
* @package    Flashgame
* @version    $Id: Level.php 6072 2010 YouNet $
* @author     To Anh
*/

class Flashgame_Form_Admin_Paidlevel extends Engine_Form
{
    public function init()
    {
        $this->setMethod('post');
        // prepare user levels
        $table = Engine_Api::_()->getDbtable('levels', 'authorization');
        $select = $table->select();
        $user_levels = $table->fetchAll($select);

        foreach ($user_levels as $user_level){
            $levels_prepared[$user_level->level_id]= $user_level->getTitle();
        }

        // category field
        $this->addElement('Select', 'level_id', array(
        'label' => 'Member Level',
        'multiOptions' => $levels_prepared,
        'onchange' => 'javascript:fetchLevelSettings(this.value);'
        ));

        // Buttons
        $this->addElement('Button', 'submit', array(
        'label' => 'Add Level',
        'type' => 'submit',
        'ignore' => true,
        'decorators' => array('ViewHelper')
        ));

        $this->addElement('Cancel', 'cancel', array(
        'label' => 'cancel',
        'link' => true,
        'prependText' => ' or ',
        'href' => '',
        'onClick'=> 'javascript:parent.Smoothbox.close();',
        'decorators' => array(
        'ViewHelper'
        )
        ));
        $this->addDisplayGroup(array('submit', 'cancel'), 'buttons');
        $button_group = $this->getDisplayGroup('buttons');

    }
}